cmake_minimum_required(VERSION 2.8)
project(controlLab)

set(wxWidgets_USE_DEBUG, TRUE)
set(wxWidgets_USE_UNICODE, TRUE)
#no idea why, but can't enable log, says lib is missing but can't find on net or in raw build of wx
#find_package(wxWidgets REQUIRED core base html xml log)
find_package(wxWidgets REQUIRED core base html xml)

include(${wxWidgets_USE_FILE})

#include_directories(${wxWidgets_INCLUDE_DIRS})
#add_definitions(${wxWidgets_DEFINITIONS})
 
set(SRCS 
	iPlugin.h
	PluginMgr.h
	PluginMgr.cpp
	ControlLabAboutDialog.h
	ControlLabAboutDialog.cpp
	ControlLab.h
	ControlLab.cpp
	ControlLabWindow.h
	ControlLabWindow.cpp
	wxWidgetsApp.h
	wxWidgetsApp.cpp
)

set(plugin_SRCS
	plugins/samplePlugin.h
	plugins/samplePlugin.cc
)

set(BINDIR ${CMAKE_BINARY_DIR}/../bin/)
#compile the plugin:
add_library (samplePlugin SHARED ${plugin_SRCS})
target_link_libraries(samplePlugin ${wxWidgets_LIBRARIES})
install (TARGETS samplePlugin DESTINATION ${BINDIR})

#win32 is added so that the console window would dissapear under windows.
add_executable(controlLab WIN32 ${SRCS})
target_link_libraries(controlLab ${wxWidgets_LIBRARIES})
install (TARGETS controlLab RUNTIME DESTINATION ${BINDIR})
